#pragma once

#include "assert.h"

class RefObj
{
public:
	RefObj()
		:_refCount(0)
	{
	}

	void Retain() const
	{ 
		assert (_refCount >= 0);
		_refCount ++; 
	}

	void Release() const
	{
		assert (_refCount > 0);
		_refCount --;
	}

	bool IsFree() const
	{
		assert (_refCount >= 0);
		return _refCount == 0;
	}

private:
	mutable int	_refCount;
};